package com.easygoods.dao;

import com.easygoods.base.BaseDao;
import com.easygoods.entity.MissionInfo;
import com.easygoods.enums.MissionState;
import com.easygoods.enums.MissionTeamState;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * Created by 许崇雷 on 2019-02-25.
 */
@Repository
public interface MissionInfoDao extends BaseDao<MissionInfo> {
    //尝试设置为已结算
    int setSettled(@Param("missionId") String missionId, @Param("missionState") MissionState missionState, @Param("missionTeamState") MissionTeamState missionTeamState);

    //尝试设置为已结算
    default int setSettled(String missionId) {
        return this.setSettled(missionId, MissionState.Settled, MissionTeamState.Normal);
    }
}
